class Results::Base < ActiveRecord::Base
  set_table_name :results
  belongs_to :work
  belongs_to :scan

  #排行总分
  def get_ranking_point
  end

  def self.point_str point
    point_s = point.to_s
    fushu = point_s.first == '-' ? true : false
    size = point_s.size - ( fushu ? 1 : 0 )
    if size <= 3
      point_s
    else
      str = ""
      point_s.delete('-').split('').each_with_index do |ch, i|
        str << "," if i > 0 && (size - i) % 3 == 0
        str << ch
      end
      fushu ? '-' + str : str
    end
  end

end
